/* @(#)TopDisplay.java   
 *
 * Project: GS-1
 *
 * Modify Information:
 * =============================================================================
 *   Author       Date       Description
 *   ------------ ---------- ---------------------------------------------------
 *   Jenny Li    2006-7-17     新增
 *
 * Copyright Notice:
 * =============================================================================
 *    Copyright (c) 2001-2006 Beijing HiTRUST Technology Co., Ltd. 1808 Room, 
 *        Science & Technology Building, No. 9 South Street, Zhong Guan Cun, 
 *        Haidian District, Beijing ,100081, China All rights reserved.
 *
 *    This software is the confidential and proprietary information of
 *        Beijing HiTRUST Technology Co., Ltd. ("Confidential Information").
 *        You shall not disclose such Confidential Information and shall use it
 *        only in accordance with the terms of the license agreement you entered
 *        into with HiTRUST.
 *
 * Warning:
 * =============================================================================
 * 
 */
package com.hitrust.gs.util.page;

import java.util.ArrayList;

import com.hitrust.gs.business.GSAfficheProcessor;
import com.hitrust.gs.business.GSMarketInfoProcessor;
import com.hitrust.gs.lib.GSLogWriter;
import com.hitrust.gs.util.exception.GSException;
import com.hitrust.gs.vo.GSMarketInfoQryVO;

/**
 * 
 */
public class TopDisplay {
    
    
    public static ArrayList getAffi(){
        ArrayList rt = new ArrayList();
        try {
            ArrayList alAffi = null;
            alAffi = GSAfficheProcessor.getAllAffiche();
            if (alAffi == null){            
                return rt;                
            }
            for (int i=0; i< alAffi.size() && i< 3; i++){
                String[] tStr = (String[])alAffi.get(i);
                if (tStr[1] != null && tStr[1].length() >35){
                    tStr[1] = tStr[1].substring(0,34)+ "…";
                } 
                rt.add(tStr);
            }
        }
        catch (GSException e) {            
            GSLogWriter.error(e.getMessage());
        } 

        return rt;
    }
    
    
    public static ArrayList getMarketInfo(){
        ArrayList rt = new ArrayList();
        GSMarketInfoQryVO miqvo;
        try {
            ArrayList alMi = null;
            GSMarketInfoProcessor mip = new GSMarketInfoProcessor();
            alMi = mip.getMarketInfoAll();
            if (alMi == null){
                return rt;
            }
            for (int i=0; i< alMi.size() && i< 3; i++){
                miqvo = (GSMarketInfoQryVO)alMi.get(i);
                if (miqvo.title != null && miqvo.title.length() >9){
                    miqvo.title = miqvo.title.substring(0,8) + "…"; 
                }
                rt.add(miqvo);
            }
            
        }
        catch (GSException e) {            
            GSLogWriter.error(e.getMessage());
        }
        return rt;
    }

    /**
     * @param args
     */
    public static void main(String[] args) {
    // TODO Auto-generated method stub

    }

}
